package com.ruoyi.system.mapper;

import com.ruoyi.system.domain.JiajiaOrder;
import com.ruoyi.system.domain.vo.IncreaseSumStatisticsVo;
import com.ruoyi.system.task.dto.OrderSettleTaskDto;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


/**
 * 订单Mapper接口
 *
 * @author knd
 * @date 2021-10-14
 */
public interface JiajiaOrderMapper
{
    /**
     * 查询订单
     *
     * @param id 订单主键
     * @return 订单
     */
    public JiajiaOrder selectJiajiaOrderById(Long id);

    /**
     * 查询订单列表
     *
     * @param jiajiaOrder 订单
     * @return 订单集合
     */
    public List<JiajiaOrder> selectJiajiaOrderList(JiajiaOrder jiajiaOrder);

    /**
     * 新增订单
     *
     * @param jiajiaOrder 订单
     * @return 结果
     */
    public int insertJiajiaOrder(JiajiaOrder jiajiaOrder);

    /**
     * 修改订单
     *
     * @param jiajiaOrder 订单
     * @return 结果
     */
    public int updateJiajiaOrder(JiajiaOrder jiajiaOrder);

    /**
     * 删除订单
     *
     * @param id 订单主键
     * @return 结果
     */
    public int deleteJiajiaOrderById(Long id);

    /**
     * 批量删除订单
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteJiajiaOrderByIds(String[] ids);

//    Map<Long,BigDecimal> selectTotalAmount(@Param("startTime")Date startTime, @Param("endTime")Date endTime);

    List<JiajiaOrder> select(@Param("wid") Long wid, @Param("startTime")Date startTime, @Param("endTime")Date endTime);

    List<OrderSettleTaskDto> selectTotalAmount(@Param("startTime")Date startTime, @Param("endTime")Date endTime);

    IncreaseSumStatisticsVo increaseSumStatistics();

    BigDecimal totalIncome(JiajiaOrder jiajiaOrder);

    BigDecimal yearIncome(JiajiaOrder jiajiaOrder);

    BigDecimal quarterIncome(JiajiaOrder jiajiaOrder);

    BigDecimal weekIncome(JiajiaOrder jiajiaOrder);

    Long totalOrderNum(JiajiaOrder jiajiaOrder);

    Long yearOrderNum(JiajiaOrder jiajiaOrder);

    Long quarterOrderNum(JiajiaOrder jiajiaOrder);

    Long weekOrderNum(JiajiaOrder jiajiaOrder);

    BigDecimal monthIncome(JiajiaOrder jiajiaOrder);

    Long selectMonthOrderNum(JiajiaOrder jiajiaOrder);

    BigDecimal selectMonthIncome(JiajiaOrder jiajiaOrder);

    Long monthOrderNum(JiajiaOrder jiajiaOrder);

    JiajiaOrder selectorderList(Long id);

    List<JiajiaOrder> selectJiajiaOrderByList(JiajiaOrder order);
}
